home *** CD-ROM | disk | FTP | other *** search
/ C & C++ Multimedia Cyber Classroom / C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso / src / fig10_02.jar / Ch10 / Fig10_02 / Point1.h < prev    next >
C/C++ Source or Header  |  1997-10-28  |  518b  |  21 lines

  1. // Fig. 10.2: point1.h
  2. // Definition of class Point
  3. #ifndef POINT1_H
  4. #define POINT1_H
  5. #include "shape.h"
  6.  
  7. class Point : public Shape {
  8. public:
  9.    Point( int = 0, int = 0 );  // default constructor
  10.    void setPoint( int, int );
  11.    int getX() const { return x; }
  12.    int getY() const { return y; }
  13.    virtual void printShapeName() const { cout << "Point: "; }
  14.    virtual void print() const;
  15. private:
  16.    int x, y;   // x and y coordinates of Point
  17. };
  18.  
  19. #endif                                          
  20.  
  21.